<div id="contentwrapper" class="contentwrapper">
	<div class="contenttitle2">
		<h3>产品类型<#if parent??>->${parent.name}</#if></h3>
	</div><!--contenttitle-->
	<button class="stdbtn update" style="float: right;">新增</button>
	<table cellpadding="0" cellspacing="0" border="0" class="stdtable">
    <colgroup>
        <col class="con0">
        <col class="con1">
        <col class="con0">
        <col class="con1">
        <col class="con0">
    </colgroup>
    <thead>
        <tr>
            <th class="head0">流水号</th>
            <th class="head1">名称</th>
            <th class="head0">操作</th>
            <th class="head1">移动</th>
        </tr>
    </thead>
    <tfoot>
        <tr>
           <th class="head0">流水号</th>
            <th class="head1">名称</th>
            <th class="head0">操作</th>
            <th class="head1">移动</th>
        </tr>
    </tfoot>
    <tbody>
    	<#list data.list as d>
        <tr>
            <td>${d.id}</td>
            <td>${d.name}</td>
            <td>
            	<button class="stdbtn update" data-id="${d.id}">编辑</button>
            	<#if !parent??>
            		<button class="stdbtn parent" data-id="${d.id}">子类型</button>		
            	</#if>
            	
            </td>
            <td >
            	<button class="stdbtn" data-id="${d.id}">↑</button>
		        <button class="stdbtn" data-id="${d.id}">↓</button>
            </td>
        </tr>
        </#list>
    </tbody>
</table>
	<div class="dataTables_paginate paging_full_numbers" id="dyntable2_paginate">
		<span class="first paginate_button paginate_button_disabled" id="dyntable2_first">首页</span>
		<span class="previous paginate_button paginate_button_disabled" id="dyntable2_previous">上一页</span>
		<span>
			<span class="paginate_active">1</span>
			<span class="paginate_button">2</span>
			<span class="paginate_button">3</span>
		</span>
		<span class="next paginate_button" id="dyntable2_next">下一页</span>
		<span class="last paginate_button" id="dyntable2_last">尾页</span>
	</div>
</div>

<script type="text/javascript">
	jQuery(".update").click(function(){
		var id= jQuery(this).data("id");
		id = id?id:0;
		var parent_id = 0;
		<#if parent??>
			parent_id=${parent.id}
		</#if>
		ajaxHtml("admin/goods/typeinfo?id="+id+"&parent_id="+parent_id);
	})
	
	jQuery(".parent").click(function(){
		var id= jQuery(this).data("id");
		id = id?id:0;
		ajaxHtml("admin/goods/typelist?parent_id="+id);
	});
	
</script>